import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;

public class ABC {
   static int N = 100010;
    static int[] a ;
    static int[] b ;
    static int[] c  ;
    static Integer[] work  ;
    static int n = 0;
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        n = s.nextInt();
        a = new int[n];b = new int[n];c = new int[n];work = new Integer[n];
        for(int i=0;i<n;i++) a[i] = s.nextInt();
        for(int i=0;i<n;i++) b[i] = s.nextInt();
        for(int i=0;i<n;i++) c[i] = s.nextInt();
        int end = Math.max(Math.max(fuc(a,b,c),fuc(b,a,c)) ,fuc(c,a,b));
        System.out.println(end);
    }
    private static int fuc(int[] a,int[] b,int[] c) {
        for(int i=0;i<a.length;i++) work[i]=a[i]-b[i]-c[i];
        Arrays.sort(work,Comparator.reverseOrder());
        long sum=0;
        int count=-1;
        for(int i=0;i<work.length;i++) {
            sum+=work[i];
              if(sum>0) count=i+1;
              else break;
        }
        return count;
    }
}
